package com.y7net.snakeplus;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Treasure implements Serializable {

	private static final long serialVersionUID = 3632454287673204697L;

	public int type;
	public String name;
	public String imgSrc;
	public int randomRange = 1;
	public int randomValue = 2;
	public int removeDelay = 5; //second
	public String desc;
//	public int holdNum;
	public List<String> bubbleMsgs;
	
	
	public Treasure(int type, String name, int randomRange, 
			int randomValue, int removeDelay, String imgSrc) {
		this.type = type;
		this.name = name;
		this.randomRange = randomRange;
		this.randomValue = randomValue;
		this.removeDelay = removeDelay;
		this.imgSrc = imgSrc;
	}
	
	public Treasure(int type, String name, int randomRange, 
			int randomValue, int removeDelay, String imgSrc, String desc) {
		this(type, name, randomRange, randomValue, removeDelay, imgSrc);
		this.desc = desc;
	}
	
	public Treasure(int type, String name, int randomRange, 
			int randomValue, int removeDelay, String imgSrc, String desc,
			String[] bubbleMsgs) {
		this(type, name, randomRange, randomValue, removeDelay, imgSrc, desc);
		if(bubbleMsgs!=null){
			this.bubbleMsgs = new ArrayList<String>();
			for(int i=0; i<bubbleMsgs.length; i++){
				this.bubbleMsgs.add(bubbleMsgs[i]);
			}
		}
	}
	
	public Treasure clone(){
		Treasure t = new Treasure(type, name, randomRange, 
				randomValue,removeDelay, imgSrc, desc);
		if(this.bubbleMsgs!=null){
			t.bubbleMsgs = new ArrayList<String>();
			t.bubbleMsgs.addAll(this.bubbleMsgs);
		}
//		t.holdNum = this.holdNum;
		return t;
	}

}
